package com.icinfo.cloud.provider.punish.service.impl;

import cn.hutool.core.util.StrUtil;
import com.icinfo.cloud.provider.common.exception.BusinessException;
import com.icinfo.cloud.provider.punish.mapper.CaseMainDetailInfoMapper;
import com.icinfo.cloud.provider.punish.service.ICaseMainDetailInfoService;
import com.icinfo.cloud.provider.punish.ucase.casemain.model.CaseMainDetailInfo;
import com.icinfo.framework.core.service.support.MyBatisServiceSupport;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * case_main_detail_info 对应的Service实现类.<br>
 * author: Kexin.Hu
 * date: 2024/3/18 15:25
 */
@Service
@Slf4j
public class CaseMainDetailInfoServiceImpl extends MyBatisServiceSupport implements ICaseMainDetailInfoService {

    @Resource
    private CaseMainDetailInfoMapper caseMainDetailInfoMapper;

    @Override
    public CaseMainDetailInfo getCaseMainDetailInfoByCaseId(String caseId) {
        if (StrUtil.isBlank(caseId)) {
            throw new BusinessException("查询案件详情宽表失败，案件id不能为空");
        }
        CaseMainDetailInfo query = new CaseMainDetailInfo();
        query.setCaseId(caseId);
        return caseMainDetailInfoMapper.selectOne(query);
    }
}
